<#macro ajaxTable title table_id heads cells >
<script type="text/javascript" charset="utf-8">
			jQuery(document).ready(function() {
				oTable = jQuery('#'+'${table_id}').dataTable(
				{	"bPaginate":true,
					"bJQueryUI": true,
					"bProcessing": true,
					"bServerSide": true,
					"iDisplayLength": 5,
					"sAjaxDataProp":"list",
					"sAjaxSource": '${dataSource}',
					"aLengthMenu": [[5,10, 25, 50], [5,10, 25, 50]],
					 "aoColumns": [
					 				<#list cells as cell>
									{ "mDataProp": "${cell}" }<#if cell_index!=cells?size-1>,</#if>
									</#list>					                
								   ] ,
					"aoColumnDefs": [{ "bSearchable": false, 
											"bSortable":false,
											"sClass":"center",
											"sWidth":"30px",
											"aTargets": [ 0 ]
									}] 
				}
				);
			} );
		</script>
 
        <!-- Alternative Content Box Start -->
         <div class="contentcontainer">
            <div class="headings altheading">
                <h2>${title}</h2>
            </div>
            <div class="contentbox">
				            
				<table cellpadding="0" cellspacing="0" border="0" class="display" id="${table_id}">
					<thead>
						<tr>
							<#list heads as head>
								<th>${head}</th>
							</#list>
						</tr>
					</thead>
					<tbody>
					</tbody>
					<tfoot>
						<tr>
							<#list heads as head>
								<th>${head}</th>
							</#list>
						</tr>
					</tfoot>	
				</table>
		</div>
	</div>
</#macro>

<#--title 表格标题,table_id 表格id,heads 表头显示的名称,rows 数据列表,cells 数据的标量名称-->
<#macro  table  title table_id heads rows cells isEditable=false>
<script type="text/javascript" charset="utf-8">
			jQuery(document).ready(function() {
				oTable = jQuery('#'+'${table_id}').dataTable(
				{	"bPaginate":false,
					"bJQueryUI": true,
					"bInfo": false, 
					"sDom": '<"toolbar">frtip',
					"aLengthMenu": [[5,10, 25, 50], [5,10, 25, 50]],
					"aoColumnDefs": [{ "bSearchable": false, 
											"bSortable":false,
											"sClass":"center",
											"sWidth":"20px",
											"aTargets": [ 0 ]
									}] 
				}
				);
				
				
				jQuery("div.toolbar").html(
						'<ul class="pagination">'+
						<#if (result.previous>0)>
							'<li class="text"><a href="${request.requestURL}<@component.exParameter pageNo='${result.previous}' />" title="">上一页</a></li>'+
						</#if>
			            '<li class="page"><a href="javascript:void(0)" title="">${result.pageNo}</a></li>'+
						<#if (result.next>0)>
							'<li class="text"><a href="${request.requestURL}<@component.exParameter pageNo='${result.next}' />" title="">下一页</a></li>'+
						</#if>
			            '<li class="text">共${result.totalPage}页</li>'+
			            '<li class="text">共${result.recordCount}条记录</li>'+
			       		'</ul>'); 
			} );
		</script>
        <!-- Alternative Content Box Start -->
         <div class="contentcontainer">
            <div class="headings altheading">
                <h2>${title}</h2>
            </div>
            <div class="contentbox">
				            
				<table cellpadding="0" width="100%" cellspacing="0" border="0" class="display" id="${table_id}">
					<thead>
						<tr>
							<th style="width:10px">  </th>
							<#list heads as head>
								<th>${head}</th>
							</#list>
							<#if isEditable>
								<th> 操作 </th>
							</#if>							
						</tr>
					</thead>
					<tbody>
							<#list rows as row>
								<#assign row_id="tr_row_${row_index?number+1}">
								<tr id="${row_id}">
								<td>${row_index?number+1}</td>
								<#list cells as cell>
									<td>${(('${"row."+cell}')?eval)?default("--")}</td>
								</#list>
								<#if isEditable>
									<td class="edit_col"> 
									<ul>
				                    	<li><img src="img/icons/icon_edit.png" alt="Edit" /><a href="javascript:component.table.eidtRow('${row_id}')"> 修改</a></li>
                        				<li><img src="img/icons/icon_delete.png" alt="Delete" /> <a href="javascript:component.table.deletRow('${row_id}')">删除</a></li>
                    				</ul>
									</td>
								</#if>
								</tr>
							</#list>							
					</tbody>
					<tfoot>
						<tr>
							<th> </th>
							<#list heads as head>
								<th>${head}</th>
							</#list>
							<#if isEditable>
								<th> 操作 </th>
							</#if>							
						</tr>
					</tfoot>	
				</table>
 				
 				<div class="extrabottom">
                    <div class="bulkactions">
                    	<#nested>
                    </div>
                </div>				
		</div>
	</div>
</#macro>